package com.game.server.message.proto.execute;

import com.comm.ISession;

import com.game.majiang.config.LogManager;
import com.game.majiang.logic.LogicClient;
import com.game.majiang.logic.LogicServer;
import com.game.majiang.logic.LogicTable;
import com.game.server.message.proto.in.AbstractGetTableinfoReq;
import com.game.server.system.AbstractTable;

public class GetTableinfoReq extends AbstractGetTableinfoReq {

    @Override
    public void Execute(ISession session) {
        LogManager.getInstance().Log("GetTableinfoReq");
        LogicClient client = (LogicClient) LogicServer.getInstance().getClient(session.getId());

        if (client != null&&client.checkClick(msgcode)) {
            LogManager.getInstance().Log(client.toString());
            LogicTable table = (LogicTable) client.getTable();

            if(table != null) {
                LogManager.getInstance().Log("房间table找到了："+table);
            	table.toTableInfo(client);
            } else {
                LogManager.getInstance().Error("房间table没有找到：");
            }
        }
    }

}
